package indi.zhifa.recipe.bailan.framework.auth.entity.annotations;

import indi.zhifa.recipe.bailan.framework.auth.entity.enums.EDataPermissionType;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 数据域权限，通常放到controller上
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface DataPermission {

    /**
     * 鉴权类型
     * @return
     */
    EDataPermissionType permissionType() default EDataPermissionType.AUTH_CASCADE;

    /**
     * 鉴权领域
     * @return
     */
    String domain();

    /**
     * 豁免的角色
     * @return
     */
    String[] exemptionRoles() default {"spAdm"};
}
